class ConstWrap(object):
    """ Wraps a object. This wrapper is special in that it disallows changing of the variable containing the
        object it wraps by external sources and defines only __getattr__ and __setattr__. This means that
        the behaviour of this object will not interfere with that of the wrapped object (even if it declares a
        __getattr__ or __setattr__ method, it will be called when a field from the other object is requested.
    """
    def __init__(self, obj):
        object.__setattr__(self, 'wrapped', obj)

    def __getattribute__(self, name):
        return getattr(object.__getattribute__(self, 'wrapped'), name)
    
    def __setattr__(self, name, value):
        setattr(object.__getattribute__(self, 'wrapped'), name, value)
